package com.mrx.commons.logback.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.Assert;

/**
 * openObserve 日志收集器参数
 *
 * @author Mr.X
 * @since 2023-12-10 上午 8:23:25
 */
@Data
@ConfigurationProperties(prefix = "xlog")
public class XLogCollectorProperties {
    private String stream;
    private String org;
    private String server;
    private String token;
    private String indexName;

    public void checkProperties() {
        Assert.hasText(stream, "xlog.stream 不能为空");
        Assert.hasText(org, "xlog.org 不能为空");
        Assert.hasText(server, "xlog.server 不能为空");
        Assert.hasText(token, "xlog.token 不能为空");
        Assert.hasText(indexName, "xlog.token 不能为空");
    }
}
